<?php

namespace Kendoctor\HelloBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class DefaultController extends Controller
{
    public function indexAction($page, $name)
    {
        return $this->render('KendoctorHelloBundle:Default:index.html.twig', array('name' => $name, 'page'=>$page));
    }
    
        
    /**
     * more than 1 args 多个参数
     * 
     * /routing/{arg1}_{arg2}-yes-{arg3}
     * 
     * @param type $arg1
     * @param type $arg2
     * @param type $arg3 
     */
    public function moreAction($arg1, $arg2, $arg3){
      return new Response(implode(":", array($arg1, $arg2, $arg3)));
    }
    
    /**
     * default value for arg 参数默认值
     * 
     * pattern:  /routing/{arg1}_{arg2}
     * defaults: { _controller: KendoctorHelloBundle:Default:default, arg1: 10 }
     * 
     * browse /web/app_dev.php/routing/1 
     *
     * @param type $arg1
     * @param type $arg2 
     */
    public function defaultAction($arg1, $arg2)
    {
        return new Response(implode(":", array($arg1, $arg2)));
      
        
    }
}
